import request from '@/config/axios'

// 告警通知记录 VO
export interface AlarmNotifyRecordVO {
  id: number // ID
  notifyTime: Date // 通知时间
  notifyContent: string // 通知内容
  pushPlatform: string // 推送平台(1:钉钉,2:飞书,3:企业微信)
}

// 告警通知记录 API
export const AlarmNotifyRecordApi = {
  // 查询告警通知记录分页
  getAlarmNotifyRecordPage: async (params: any) => {
    return await request.get({ url: `/vmiot/alarm-notify-record/page`, params })
  },

  // 查询告警通知记录详情
  getAlarmNotifyRecord: async (id: number) => {
    return await request.get({ url: `/vmiot/alarm-notify-record/get?id=` + id })
  },

  // 新增告警通知记录
  createAlarmNotifyRecord: async (data: AlarmNotifyRecordVO) => {
    return await request.post({ url: `/vmiot/alarm-notify-record/create`, data })
  },

  // 修改告警通知记录
  updateAlarmNotifyRecord: async (data: AlarmNotifyRecordVO) => {
    return await request.put({ url: `/vmiot/alarm-notify-record/update`, data })
  },

  // 删除告警通知记录
  deleteAlarmNotifyRecord: async (id: number) => {
    return await request.delete({ url: `/vmiot/alarm-notify-record/delete?id=` + id })
  },

  // 导出告警通知记录 Excel
  exportAlarmNotifyRecord: async (params) => {
    return await request.download({ url: `/vmiot/alarm-notify-record/export-excel`, params })
  }
}